import { v4 as uuid } from 'uuid';

/**
 * 左侧组件
 */
export const leftComponents = [
  {
    title: '基础控件',
    list: [
      {
        __config__: {
          label: '单行输入框',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          required: false,
          name: uuid(),
        },
        __component__: {
          disabled: false,
          placeholder: '请输入',
        },
        tag: 'Input',
        tagIcon: 'iconoir:input-field',
        defaultValue: null,
        span: 24,
      },
      {
        __config__: {
          label: '多行输入框',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
          placeholder: '请输入',
        },
        tag: 'TextArea',
        tagIcon: 'bi:textarea-resize',
        defaultValue: null,
        span: 24,
      },
      {
        __config__: {
          label: '密码输入框',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
          placeholder: '请输入',
          autocomplete: true,
        },
        tag: 'InputPassword',
        tagIcon: 'fluent:password-20-regular',
        defaultValue: null,
        span: 24,
      },
      {
        __config__: {
          label: '数字输入框',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
          placeholder: '请输入',
          style: { width: '100%' },
        },
        tag: 'InputNumber',
        tagIcon: 'carbon:character-whole-number',
        defaultValue: null,
        span: 24,
      },
      {
        __config__: {
          label: '开关',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
        },
        tag: 'Switch',
        tagIcon: 'iconoir:switch-off-outline',
        defaultValue: false,
        span: 24,
      },
      {
        __config__: {
          label: '单选框组',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
          options: [
            { label: '选项一', value: 'one', disabled: false },
            { label: '选项二', value: 'two', disabled: false },
          ],
          optionType: 'default',
          buttonStyle: 'outline',
        },
        __data__: {
          type: 'static',
        },
        tag: 'Radio',
        tagIcon: 'eva:radio-button-on-fill',
        defaultValue: null,
        span: 24,
      },
      {
        __config__: {
          label: '多选框组',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
          options: [
            { label: '选项一', value: 'one', disabled: false },
            { label: '选项二', value: 'two', disabled: false },
          ],
        },
        __data__: {
          type: 'static',
        },
        tag: 'CheckBox',
        tagIcon: 'carbon:checkbox-checked',
        defaultValue: null,
        span: 24,
      },
      {
        __config__: {
          label: '选择器',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
          placeholder: '请选择',
          options: [
            { label: '选项一', value: 'one', disabled: false },
            { label: '选项二', value: 'two', disabled: false },
          ],
          mode: 'combobox',
        },
        __data__: {
          type: 'static',
        },
        tag: 'Select',
        tagIcon: 'gg:select-o',
        defaultValue: [],
        span: 24,
      },
      {
        __config__: {
          label: '级联选择',
          labelCol: { span: 4, offset: 0 },
          rules: [{ required: false }],
          name: uuid(),
        },
        __component__: {
          disabled: false,
          placeholder: '请选择',
          options: [],
          mode: 'combobox',
        },
        __data__: {
          type: 'static',
        },
        tag: 'Cascader',
        tagIcon: 'eos-icons:action-chains-outlined',
        defaultValue: [],
        span: 24,
      },
    ],
  },
];

export const filterConfig = {
  /** 校验 */
  required: ['Switch'],
};
